from collections import defaultdict


class Solution:
    def numBusToDestinations(self, routes,source,target) -> int:
        if source == target:
            return 0
        stop_to_buses = defaultdict(set)
        for bus_index, route in enumerate(routes):
            for stop in route:
                stop_to_buses[stop].add(bus_index)
                print(stop_to_buses)
    



if __name__ == '__main__':
    solution = Solution()
    print(solution.numBusToDestinations(routes=[[1,2,7],[3,6,7]],source=1,target=6))
